cmake_minimum_required(VERSION 3.5.1)

include_directories("../roadengine/src")

add_library(map_opendrive_adapter coordinate_convert_tool.cc
                                  opendrive_adapter.cc
                                  proto_organizer.cc
                                  odr_adapter.cc

                                  xml_parser/header_xml_parser.cc
                                  xml_parser/junctions_xml_parser.cc
                                  xml_parser/lanes_xml_parser.cc
                                  xml_parser/objects_xml_parser.cc
                                  xml_parser/roads_xml_parser.cc
                                  xml_parser/signals_xml_parser.cc
                                  xml_parser/util_xml_parser.cc
                        
                               odr_parser/convert_to_hdmap.cc
                               odr_parser/convert_curve_offset.cc
                               odr_parser/header_odr_parser.cc
                               odr_parser/junctions_odr_parser.cc
                               odr_parser/lanes_odr_parser.cc
                               odr_parser/objects_odr_parser.cc
                               odr_parser/roads_odr_parser.cc
                               odr_parser/signals_odr_parser.cc
                               odr_parser/util_odr_parser.cc
                               odr_parser/roadengine_api.cc 
                
                               odr_parser/geometry_util/WorldSpiralIterator.cpp
                               odr_parser/geometry_util/WorldArcIterator.cpp
                               odr_parser/geometry_util/odrSpiral.c
            
                               )









target_link_libraries(map_opendrive_adapter common::math
                                            common::status
                                            common::util
                                            map::proto
                                            cyber::common
                                            roadengine
                                            ${TINYXML2_LIBRARIES}
                                            ${PROJ4_LIBRARIES})

add_library(map::opendrive_adapter ALIAS map_opendrive_adapter)

add_library(map_opendrive_adapter_module INTERFACE)
target_link_libraries(map_opendrive_adapter_module INTERFACE
        map_opendrive_adapter
        )





install(TARGETS map_opendrive_adapter
                map_opendrive_adapter_module
        EXPORT  apollo-export
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib
        RUNTIME DESTINATION bin
        INCLUDES DESTINATION .
        )

